<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动漫社区</title>
    <style>
        /* 全局样式 */
        body {
            margin: 0;
            padding: 0;
            font-family: 'Arial', sans-serif;
            color: #333;
            background: linear-gradient(135deg, #ff9a9e, #fad0c4);
        }

        /* 动态背景粒子效果 */
        .particles {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
        }

        .particles span {
            position: absolute;
            background: rgba(255, 255, 255, 0.5);
            border-radius: 50%;
            animation: float 5s infinite ease-in-out;
        }

        @keyframes float {
            0% { transform: translateY(0) translateX(0); }
            50% { transform: translateY(-20px) translateX(20px); }
            100% { transform: translateY(0) translateX(0); }
        }
        .anime-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px;
            width: 100%;
            max-width: 1200px;
        }

        .anime-card {
            background: rgba(255, 255, 255, 0.9);
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            text-align: center;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
        }

        .anime-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
        }

        .anime-card img {
            width: 100%;
            border-radius: 10px;
            margin-bottom: 15px;
        }

        .anime-card h3 {
            font-size: 24px;
            margin-bottom: 10px;
        }

        .anime-card p {
            font-size: 16px;
            color: #555;
        }

        /* 欢迎动画 */
        #welcome-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #ff9a9e, #fad0c4);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 2rem;
            color: white;
            z-index: 1000;
            animation: fadeOut 2s ease-in-out forwards;
        }

        @keyframes fadeOut {
            0% { opacity: 1; }
            100% { opacity: 0; display: none; }
        }

        /* 菜单栏 */
        #menu-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background-color: rgba(255, 255, 255, 0.9);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 100;
            padding: 0 20px;
            padding-right: calc(20px + 17px); /* 右侧留出滚动条的空间 */
        }

        #menu-bar .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: #ff6f61;
        }

        #menu-bar .user-info {
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        #menu-bar .user-info img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
        }

        #menu-bar .user-info span {
            font-size: 1rem;
            color: #333;
        }

        /* 左侧导航栏 */
        #sidebar {
            position: fixed;
            top: 60px;
            left: -200px;
            width: 200px;
            height: calc(100% - 60px);
            background-color: rgba(255, 255, 255, 0.9);
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            transition: left 0.3s ease;
            z-index: 99;
        }

        /* 左侧五分之一宽度触发显示 */
        body:hover #sidebar {
            left: 0;
        }

        /* 左侧五分之一宽度范围 */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 20%; /* 左侧五分之一宽度 */
            height: 100%;
            z-index: 98;
        }

        body:hover::before {
            display: none;
        }

        #sidebar ul {
            list-style: none;
            padding: 20px;
        }

        #sidebar ul li {
            margin: 15px 0;
        }

        #sidebar ul li a {
            text-decoration: none;
            color: #333;
            font-size: 1rem;
        }

        #sidebar ul li a:hover {
            color: #ff6f61;
        }
        /* 菜单栏动态背景 */
        #menu-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: linear-gradient(135deg, rgba(255, 154, 158, 0.9), rgba(250, 208, 196, 0.9));
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            z-index: 100;
            overflow: hidden;
        }

        #menu-bar::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
            animation: glow 6s infinite linear;
            z-index: -1;
        }

        @keyframes glow {
            0% { transform: translate(0, 0); }
            50% { transform: translate(50%, 50%); }
            100% { transform: translate(0, 0); }
        }

        /* 侧边栏动态背景 */
        #sidebar {
            position: fixed;
            top: 60px;
            left: -200px;
            width: 200px;
            height: calc(100% - 60px);
            background: linear-gradient(135deg, rgba(255, 154, 158, 0.9), rgba(250, 208, 196, 0.9));
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            transition: left 0.3s ease;
            z-index: 99;
            overflow: hidden;
        }

        #sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 200%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: flow 6s infinite linear;
            z-index: -1;
        }

        @keyframes flow {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        /* 左侧五分之一宽度触发显示 */
        body:hover #sidebar {
            left: 0;
        }

        /* 左侧五分之一宽度范围 */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 20%; /* 左侧五分之一宽度 */
            height: 100%;
            z-index: 98;
        }

        body:hover::before {
            display: none;
        }
        /* 右侧滚动条 */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        ::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        /* 主要内容 */
        #main-content {
            margin-left: 0;
            padding: 80px 20px 20px;
            transition: margin-left 0.3s ease;
            min-height: 100vh; /* 确保内容高度足够 */
        }

        body:hover #main-content {
            margin-left: 200px;
        }

        .section {
            background-color: rgba(255, 255, 255, 0.9);
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .section h2 {
            margin-top: 0;
            color: #ff6f61;
        }

        /* 评论区 */
        .comment {
            display: flex;
            margin-bottom: 15px;
        }

        .comment img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
        }

        .comment .content {
            flex: 1;
        }

        .comment .content p {
            margin: 0;
            font-size: 0.9rem;
            color: #555;
        }

        /* 排行榜 */
        .rank-list {
            list-style: none;
            padding: 0;
        }

        .rank-list li {
            margin: 10px 0;
            font-size: 0.9rem;
            color: #333;
        }

        /* 猜你喜欢 */
        .recommendation {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .recommendation .item {
            width: calc(33.33% - 10px);
            background-color: #f9f9f9;
            padding: 10px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .recommendation .item img {
            width: 100%;
            border-radius: 8px;
        }

        .recommendation .item p {
            margin: 10px 0 0;
            font-size: 0.9rem;
            color: #333;
        }
        .pagination {
            text-align: center;
            margin-top: 20px;
        }

        .pagination a {
            margin: 0 10px;
            text-decoration: none;
            color: #007bff;
        }

        .pagination a:hover {
            text-decoration: underline;
        }
    /*    查看全部按钮*/
        .dynamic-link {
            text-decoration: none; /* 去掉下划线 */
            display: inline-block; /* 使 <a> 标签可以设置宽度和高度 */
        }

        .dynamic-link button {
            background-color: #ff69b4; /* 粉色背景 */
            color: white; /* 白色文字 */
            border: none; /* 去掉边框 */
            padding: 10px 20px; /* 内边距 */
            font-size: 1rem; /* 字体大小 */
            border-radius: 25px; /* 圆角 */
            cursor: pointer; /* 鼠标悬停时显示手型 */
            position: relative; /* 相对定位 */
            overflow: hidden; /* 隐藏溢出的伪元素 */
            transition: background-color 0.3s ease, transform 0.2s ease; /* 过渡效果 */
        }

        /* 鼠标悬停效果 */
        .dynamic-link button:hover {
            background-color: #ff1493; /* 更深的粉色 */
            transform: translateY(-3px); /* 轻微上移 */
        }

        /* 点击效果 */
        .dynamic-link button:active {
            transform: translateY(0); /* 点击时恢复原位 */
            background-color: #ff69b4; /* 恢复原始背景色 */
        }

        /* 动态背景效果 */
        .dynamic-link button::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); /* 径向渐变 */
            transform: translate(-50%, -50%) scale(0); /* 初始状态 */
            transition: transform 0.5s ease;
            z-index: 0;
        }

        .dynamic-link button:hover::before {
            transform: translate(-50%, -50%) scale(1); /* 悬停时展开 */
        }

        /* 文字样式 */
        .dynamic-link button span {
            position: relative; /* 相对定位 */
            z-index: 1; /* 确保文字在伪元素之上 */
        }
    </style>
</head>
<body>
<!-- 动态背景粒子 -->
<div class="particles">
    <span style="top: 10%; left: 20%; width: 10px; height: 10px;"></span>
    <span style="top: 30%; left: 50%; width: 15px; height: 15px;"></span>
    <span style="top: 70%; left: 80%; width: 12px; height: 12px;"></span>
    <span style="top: 50%; left: 10%; width: 8px; height: 8px;"></span>
</div>

<!-- 欢迎动画 -->
<div id="welcome-animation">
    欢迎来到动漫社区！
</div>

<!-- 菜单栏 -->
<div id="menu-bar">
    <div class="logo">动漫社区</div>

    <a th:href="@{/user/{username}(username=${session.currentUser.username})}" class="user-info">
        <img src="https://via.placeholder.com/40" alt="用户头像">
        <span th:text="${session.currentUser.nickname}">用户名</span>
    </a>

</div>

<!-- 左侧导航栏 -->
<div id="sidebar">
    <ul>
        <li><a href="#anime">动漫展示</a></li>
        <li><a href="#comments">评论区</a></li>
        <li><a href="#rank">热门动画排行榜</a></li>
        <li><a href="#recommend">猜你喜欢</a></li>
        <li><a href="#about">关于我们</a></li>
    </ul>
</div>

<!-- 主要内容 -->
<div id="main-content">
    <!-- 动漫展示 -->

    <div class="section" id="anime">
        <h2>动漫展示</h2>
        <p th:text="${session.currentUser} ?: '未登录'"></p>
        <p>这里是动漫展示区。</p>

        <!-- 动漫简介卡片 -->
        <div class="anime-grid">
            <!-- 卡片 1 -->
            <div class="anime-card" onclick="window.location.href='Test1.html'">
                <img src="https://via.placeholder.com/200x150" alt="Anime Image">
                <h3>《奇蛋物语》</h3>
                <p>            《奇蛋物语》（Wonder Egg Priority）是由 CloverWorks 制作的原创电视动画，于 2021 年 1 月首播。
                    故事讲述了少女们在梦境中通过“奇蛋”拯救他人的故事，探讨了青春期少女的心理问题和社会议题。</p>
            </div>

            <!-- 卡片 2 -->
            <div class="anime-card" onclick="window.location.href='Test2.html'">
                <img src="https://via.placeholder.com/200x150" alt="Anime Image">
                <h3>《It"s MYGO!!!!!》</h3>
                <p>      作品以其深刻的情感描写和精彩的音乐表演赢得了观众的喜爱。</p>
            </div>

            <!-- 卡片 3 -->
            <div class="anime-card" onclick="window.location.href='/Test3.html'">
                <img src="https://via.placeholder.com/200x150" alt="Anime Image">
                <h3>《轻音少女》</h3>
                <p>《轻音少女》以其轻松愉快的校园生活和动人的音乐表演，成为一部经典的治愈系动画。 作品通过四位少女的成长故事，展现了友情、梦想和青春的美好。</p>
            </div>
        </div>
        <a class="dynamic-link" onclick="window.location.href='/anime-list'"><button>查看全部</button></a>
    </div>

    <!-- 评论区 -->
    <div class="section" id="comments">
        <h2>评论区</h2>
        <div class="comment">
            <img src="https://via.placeholder.com/40" alt="用户头像">
            <div class="content">
                <p>这个动漫太好看了！</p>
            </div>
        </div>
        <div class="comment">
            <img src="https://via.placeholder.com/40" alt="用户头像">
            <div class="content">
                <p>期待下一集！</p>
            </div>
        </div>
        <a class="dynamic-link" onclick="window.location.href='/comments'"><button>查看全部</button></a>
    </div>

    <!-- 热门动画排行榜 -->
    <div class="section" id="rank">
        <h2>热门动画排行榜</h2>
        <ul class="rank-list">
            <li>1. 动漫A</li>
            <li>2. 动漫B</li>
            <li>3. 动漫C</li>
        </ul>
    </div>

    <!-- 猜你喜欢 -->
    <div class="section" id="recommend">
        <h2>猜你喜欢</h2>
        <div class="recommendation">
            <div class="item">
                <img src="https://via.placeholder.com/150" alt="推荐动漫">
                <p>推荐动漫1</p>
            </div>
            <div class="item">
                <img src="https://via.placeholder.com/150" alt="推荐动漫">
                <p>推荐动漫2</p>
            </div>
            <div class="item">
                <img src="https://via.placeholder.com/150" alt="推荐动漫">
                <p>推荐动漫3</p>
            </div>
        </div>
    </div>

    <!-- 关于我们 -->
    <div class="section" id="about">
        <h2>关于我们</h2>
        <p>这里是关于我们的介绍。</p>
    </div>
</div>
</body>
</html>